class Venta::LineaVentasController < ApplicationController
  # GET /venta/linea_ventas
  # GET /venta/linea_ventas.xml
  def index
    @venta_linea_ventas = Venta::LineaVenta.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @venta_linea_ventas }
    end
  end

  # GET /venta/linea_ventas/1
  # GET /venta/linea_ventas/1.xml
  def show
    @venta_linea_venta = Venta::LineaVenta.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @venta_linea_venta }
    end
  end

  # GET /venta/linea_ventas/new
  # GET /venta/linea_ventas/new.xml
  def new
    @venta_linea_venta = Venta::LineaVenta.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @venta_linea_venta }
    end
  end

  # GET /venta/linea_ventas/1/edit
  def edit
    @venta_linea_venta = Venta::LineaVenta.find(params[:id])
  end

  # POST /venta/linea_ventas
  # POST /venta/linea_ventas.xml
  def create
    @venta_linea_venta = Venta::LineaVenta.new(params[:venta_linea_venta])

    respond_to do |format|
      if @venta_linea_venta.save
        format.html { redirect_to(@venta_linea_venta, :notice => 'Linea venta was successfully created.') }
        format.xml  { render :xml => @venta_linea_venta, :status => :created, :location => @venta_linea_venta }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @venta_linea_venta.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /venta/linea_ventas/1
  # PUT /venta/linea_ventas/1.xml
  def update
    @venta_linea_venta = Venta::LineaVenta.find(params[:id])

    respond_to do |format|
      if @venta_linea_venta.update_attributes(params[:venta_linea_venta])
        format.html { redirect_to(@venta_linea_venta, :notice => 'Linea venta was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @venta_linea_venta.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /venta/linea_ventas/1
  # DELETE /venta/linea_ventas/1.xml
  def destroy
    @venta_linea_venta = Venta::LineaVenta.find(params[:id])
    @venta_linea_venta.destroy

    respond_to do |format|
      format.html { redirect_to(venta_linea_ventas_url) }
      format.xml  { head :ok }
    end
  end
end
